<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Title</title>
</head>
<body>
	<script>
		function add(a, b = 1) {
			return a + b;
		}
		console.log(add(10));
		console.log(add(10, 2));
		
		function fun(...values) {
			for (let i = 0; i < values.length; i++) {
				console.log(values[i]);
			}
			console.log('------------')
		}
		fun(1, 2) //2
		fun(1, 2, 3, 4) //4
	</script>
</body>
</html>